package cn.cckggroup.springboot.study.controller;

import cn.cckggroup.springboot.study.dto.OrderDTO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author zz
 * @date 2023/3/1
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @GetMapping("/get")
    public OrderDTO get(@RequestParam("billNo") String billNo) {
        return OrderDTO.builder()
                .billNo(billNo)
                .price("100.0")
                .orderDate(new Date().toString())
                .userName("驰骋天下")
                .userMobile("15005700990")
                .userAddress("纵横万里").build();
    }
}
